import { defineEventHandler, readBody } from 'h3';

export default defineEventHandler(async (event) => {
  const body = await readBody(event);
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
  const { eventName, resourceType, resourceId, payload } = body;

  // 模拟事件发布
  const result = {
    eventId: `evt_${Date.now()}`,
    published: true,
  };

  return {
    code: 0,
    data: result,
    message: '事件发布成功',
  };
});
